package com.example.administrator.uicustomviews;

import android.content.Context;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.Toast;

/**
 * @Description：
 * @Author： Tye
 * @Date： 2018-03-20
 */

public class TitleLayout extends LinearLayout {
    private static final String TAG = "TitleLayout";

    public TitleLayout(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
        LayoutInflater.from(context).inflate(R.layout.layout_title, this);
        Button titleBack = findViewById(R.id.title_back);
        titleBack.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View view) {
                Toast.makeText(getContext(), "Clicked back button", Toast.LENGTH_SHORT).show();
            }
        });
    }
}
